package ua.selenium.search;

import java.util.List;
import java.util.NoSuchElementException;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

public class SearchExistingFilm extends ua.selenium.search.pages.TestBase {

	@Test
	public void searchExistingFilm() throws Exception {

		WebElement searchField = driver.findElement(By.id("q"));
		searchField.click();
		searchField.sendKeys("before");
		searchField.sendKeys(Keys.ENTER);
		if (!isElementPresent(By.className("title"))) {
			throw new NoSuchElementException();
		}

	}
}
